package mis.ds.ps.ui;

import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class UiFacade {
    String[] myStrings = new String[] {"(none)","Teste1","Teste2","Teste3","Teste4"};
    List<String> mappers = new ArrayList<String>();
    //HashMap<String,HashMap<String,String>> hashTree = new HashMap<String,HashMap<String,String>>();    
    HashMap<String,Object> hashValores = new HashMap<String,Object>();
    HashMap<String,Map<String, Object>> hashEntidades = new HashMap<String,Map<String, Object>>();    
	    
    public UiFacade() {
//	        mappers.add("(none)");
//	        mappers.add("Teste1");
//	        mappers.add("Teste2");
//	        mappers.add("Teste3");
//	        mappers.add("Teste4");
    	
//        String[] keys = {"Nome", "Valor", "Nome", "Valor"};
//        String[] values = {"Id", "A1:A10", "Nome", "B1:B10"};
//        
//        for (int i = 0; i < keys.length; ++i) {  
//            hashValores.put(keys[i], values[i]);
//        }
	        
        mappers = Arrays.asList(myStrings);

        hashValores.put("Id", "A1:A10");
        hashValores.put("Nome", "B1:B10");
        
        hashEntidades.put("Docentes", hashValores);
        hashEntidades.put("Aulas", hashValores);
        
        try {
	        HashMap<String,Object> hv2 =  (HashMap<String, Object>) hashValores.clone();        
	        hv2.put("Obs", "C1:C10;D1:D10");        
	        hashEntidades.put("Turmas", hv2);
        } catch (Exception e) {
        	
        }
        
        HashMap<String,Object> hv3 = (HashMap<String,Object>)hashValores.clone();
        hv3.put("Other", "");
        hv3.put("Color", "");
        
        hashEntidades.put("Salas", hv3);
	        
//	        hashValores.put("Nome", "Nome");
//	        hashValores.put("Valor", "B1:B10");
	        
    }
    
    public List<String> getMappersList() {
        return mappers;
    }
    
    public Map<String,Map<String,Object>> useMapper(String name) {
        System.out.println(name);
        return hashEntidades;
    }

	public void setWorkingFile(File importFile) {

	}

	public Map<String, Map<String, String>> getMapper(String mapperName) {
		return null;

	}

	public Map<String, Map<String, String>> getMapperByName(String mapperName) {
		return null;
	}
}
